//
//  DreamColorViewController.m
//  AndCampus
//
//  Created by 史宵宵 on 2018/3/8.
//  Copyright © 2018年 史宵宵. All rights reserved.
//

#import "DreamColorViewController.h"

@interface DreamColorViewController ()<UIGestureRecognizerDelegate>

@end

@implementation DreamColorViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disSeleteMood:)];
    tap.delegate=self;
    [self.view addGestureRecognizer:tap];
    self.view.userInteractionEnabled = YES;
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
    if (touch.view==self.view) {
        return YES;
    }
    else
        return NO;
}
- (void)disSeleteMood:(UITapGestureRecognizer *)tap{
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

- (IBAction)dream:(id)sender {
}
- (IBAction)clearButton:(id)sender {
    if (self.clearBlock) {
        self.clearBlock();
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (IBAction)greenButton:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 98, 180, 90));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (IBAction)yellowClolor:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 254, 246, 101));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (IBAction)darkGreenColor:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 51, 123, 40));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (IBAction)redColorButton:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 234, 53, 56));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (IBAction)lightBlue:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 127, 232, 224));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (IBAction)darkBlueButton:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 16, 56, 228));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (IBAction)lightPerpul:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 134, 137, 241));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

//棕色
- (IBAction)brownButton:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 125, 129, 75));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (IBAction)moreBlueColorButton:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 54, 120, 119));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

//黑色
- (IBAction)darkColorButton:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 4, 2, 3));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

//深棕色
- (IBAction)darkBrownClolor:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 132, 60, 23));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

//紫色
- (IBAction)perpulButton:(id)sender {
    if (self.selectColorBlock) {
        self.selectColorBlock(RGBColor( 227, 73, 237));
    }
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
